import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

/**
 * 
 * this class for message in window
 *
 */
public class MsgWin extends JFrame  {

	

	private JPanel msgPanel;
	private JLabel lblMsg;
	private JLabel lblMsg1;
	private String msg1;
	private JLabel lblMsg2;
	private String msg2;
	
	/**
	 * @wbp.parser.constructor
	 */
	public MsgWin (String s){
		msg1 = s;
		initialize1();
	}
	
	public MsgWin (String s1, String s2){
		msg1 = s1;
		msg2 = s2;
		initialize2();
	}
	
	private void initialize1() {
		
		this.setSize(342, 187);
		this.setLocation(430, 200);
		msgPanel = new JPanel();
		getContentPane().add(msgPanel);
		msgPanel.setLayout(null);
		msgPanel.add(getOK());
		
		lblMsg = new JLabel("Massage");
		lblMsg.setBounds(131, 11, 117, 14);
		msgPanel.add(lblMsg);
		
		lblMsg1 = new JLabel(msg1);
		lblMsg1.setHorizontalAlignment(SwingConstants.CENTER);
		lblMsg1.setBounds(-15, 55, 357, 14);
		msgPanel.add(lblMsg1);
		this.setTitle("Academic Managment Tool");
		this.setVisible(true);
	}	
	
	
	private JButton getOK()
	{
		JButton btnOKButton = new JButton("OK");
		btnOKButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
			}
		});
		btnOKButton.setBounds(120, 115, 89, 23);
		return btnOKButton;
	}
	
	private void initialize2() {
		
		this.setSize(342, 187);
		msgPanel = new JPanel();
		getContentPane().add(msgPanel);
		msgPanel.setLayout(null);
		this.setLocation(80, 80);
		
		msgPanel.add(getOK());
		
		lblMsg = new JLabel("Massage");
		lblMsg.setBounds(147, 11, 46, 14);
		msgPanel.add(lblMsg);
		
		lblMsg1 = new JLabel(msg1);
		lblMsg1.setHorizontalAlignment(SwingConstants.CENTER);
		lblMsg1.setBounds(-15, 48, 357, 14);
		msgPanel.add(lblMsg1);
		
		lblMsg2 = new JLabel(msg2);
		lblMsg2.setHorizontalAlignment(SwingConstants.CENTER);
		lblMsg2.setBounds(-15, 65, 357, 14);
		msgPanel.add(lblMsg2);
		
		this.setTitle("Academic Managment Tool");
		this.setVisible(true);
	}	
	
	

	
}